# 枚举类型
from enum import Enum

class OrderStatus(str, Enum):
    """订单状态"""
    # 支付失败的时候只要没过超时时间，订单状态仍然是待支付状态
    PENDING = "pending"       # 待支付
    PAID = "paid"             # 已支付
    SHIPPED = "shipped"       # 已发货
    COMPLETED = "completed"   # 已完成
    CANCELLED = "cancelled"   # 已取消

class PaymentChannel(str, Enum):
    """支付渠道"""
    WECHAT = "wechat"
    ALIPAY = "alipay"
    UNIONPAY = "unionpay"
    BALANCE = "balance"

class PaymentStatus(str, Enum):
    """支付状态"""
    PENDING = "pending"       # 待支付
    PAID = "paid"             # 支付成功
    FAILED = "failed"         # 支付失败
    REFUNDING = "refunding"   # 退款中
    REFUNDED = "refunded"     # 已退款
    TIMEOUT = "timeout"       # 支付超时
    CANCELLED = "cancelled"   # 已取消